﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;
using System.Data;
namespace DAL
{
   public class ClassBkDAL
    {
        DBHelper db = new DBHelper();
        public List<ClassBk> GetListAll() {
            string sql = "select CuntID, CuntC from [dbo].[ClassBk]";
            DataTable dt = db.GetData(sql).Tables[0];
            List<ClassBk> list = null;
            if (dt.Rows.Count>0)
            {
                list = new List<ClassBk>();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    ClassBk bc = new ClassBk();
                    bc.CuntID = Convert.ToInt32(dt.Rows[i]["CuntID"].ToString());
                    bc.CuntC = dt.Rows[i]["CuntC"].ToString();
                    list.Add(bc);
                }
            }
            return list;
        }
    }
}
